package com.webflux.springwebflux.dao;

import com.webflux.springwebflux.pojo.Test;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;


@Repository
public interface TestDao extends ReactiveCrudRepository<Test, String> {

    @Query("select top 1 * from test where id = :id")
    Mono<Test> getTestInfoById(int id);
    @Query("select * from test")
    Flux<Test> getList();
}
